package com.thb.pay.api.order;

import com.thb.pay.api.order.fallback.PayOrderServiceApiFallbackFactory;
import com.thb.pay.api.order.vo.req.PayOrderPageReq;
import com.thb.pay.api.order.vo.req.PayOrderReq;
import com.thb.pay.api.order.vo.resp.PayOrderVo;
import com.thb.pay.core.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description 支付订单服务
 * @Author lucky
 * @data 2019/10/24
 */
@FeignClient(value = "pay-service", fallbackFactory = PayOrderServiceApiFallbackFactory.class)
@RequestMapping("/payOrderServiceApi")
public interface PayOrderServiceApi {

    @RequestMapping(value = "/findPage", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    PageResult<PayOrderVo> findPage(@RequestBody PayOrderPageReq pageReq);

    @RequestMapping(value = "/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void add(@RequestBody PayOrderReq payOrderReq);


    @RequestMapping(value = "/update", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void update(@RequestBody PayOrderReq payOrderReq);

    @RequestMapping(value = "/getById", method = RequestMethod.GET)
    PayOrderVo getById(@RequestParam("id") Long id);

    @RequestMapping(value = "/getByOrderNum", method = RequestMethod.GET)
    PayOrderVo getByOrderNum(@RequestParam("orderNum") String orderNum);

    @RequestMapping(value = "/getByMerchantOrderNum", method = RequestMethod.GET)
    PayOrderVo getByMerchantOrderNum(@RequestParam("merchantOrderNum") String merchantOrderNum);

    @RequestMapping(value = "/getByThirdOrderNum", method = RequestMethod.GET)
    PayOrderVo getByThirdOrderNum(@RequestParam("thirdOrderNum") String thirdOrderNum);


}
